package com.surenpi.jenkins.client.credential;

import java.util.HashMap;
import java.util.Map;

public class SecretTextCredential extends Credential {
   public static final String TYPENAME = "Secret text";
   private static final String CLASSNAME = "org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl";
   private String secret;

   public SecretTextCredential() {
      this.setTypeName("Secret text");
   }

   public String getSecret() {
      return this.secret;
   }

   public void setSecret(String secret) {
      this.secret = secret;
   }

   public Map<String, Object> dataForCreate() {
      Map<String, String> innerMap = new HashMap();
      innerMap.put("scope", this.getScope());
      innerMap.put("id", this.getId());
      innerMap.put("secret", this.getSecret());
      innerMap.put("description", this.getDescription());
      innerMap.put("$class", "org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl");
      innerMap.put("stapler-class", "org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl");
      Map<String, Object> data = new HashMap();
      data.put("", "1");
      data.put("credentials", innerMap);
      return data;
   }

   public Map<String, Object> dataForUpdate() {
      Map<String, Object> data = new HashMap();
      data.put("scope", this.getScope());
      data.put("id", this.getId());
      data.put("secret", this.getSecret());
      data.put("description", this.getDescription());
      data.put("stapler-class", "org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl");
      return data;
   }
}
